#封装生成token
def create_token(model_object):
    from rest_framework_jwt.settings import api_settings
    jwt__payload_handler = api_settings.JWT_PAYLOAD_HANDLER
    jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER

    payload = jwt__payload_handler(model_object)
    token = jwt_encode_handler(payload)

    return token
